#ifndef _BSP_MAGNETIC_H
#define _BSP_MAGNETIC_H
#include "driver/ledc.h"
#include "driver/gpio.h"

#define LEDC_TIMER              LEDC_TIMER_0
#define LEDC_MODE               LEDC_LOW_SPEED_MODE
#define LEDC_OUTPUT_IO1         (GPIO_NUM_10) 
#define LEDC_CHANNEL1           LEDC_CHANNEL_0
#define LEDC_DUTY_RES           LEDC_TIMER_13_BIT // Set duty resolution to 13 bits
#define LEDC_FREQUENCY          (12) 


#define GPIO_CL_220V_PORT1      GPIO_NUM_5

#define GPIO_XUSHI_PORT1        GPIO_NUM_7
#define GPIO_CL_PIN_SEL       ((1ULL<<GPIO_XUSHI_PORT1) | (1ULL<<GPIO_CL_220V_PORT1) | (1ULL<<LEDC_OUTPUT_IO1))

enum{
    SHI_MODE = 0,
    XU_MODE = 1,
};


enum{
    MAINPWM_NORMAL = 0,
    MAINPWM_DUTYCHANGE = 1,
    MAINPWM_STOP = 2,
};

enum{
    MAG_220V_NORMAL = 1,
    MAG_220V_DUTYCHANGE = 2,
    MAG_220V_STOP = 3,
};

void magnetic_init(void);
void magnetic_xushi_set(uint8_t xushi_status);
void magnetic_output_mode(uint8_t output_mode);

#endif




